{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "dc05d852",
   "metadata": {},
   "source": [
    "# 用户输入\n",
    "\n",
    "#### while True + count 计数器  VS  for循环 + range()\\\n",
    "#### while True + 结束条件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "706c7e94",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "你还是笑起来最好看了~ 5\n",
      "你还是笑起来最好看了~ 10\n",
      "你还是笑起来最好看了~ 15\n",
      "你还是笑起来最好看了~ 20\n",
      "你还是笑起来最好看了~ 25\n",
      "你还是笑起来最好看了~ 30\n",
      "你还是笑起来最好看了~ 35\n",
      "你还是笑起来最好看了~ 40\n",
      "你还是笑起来最好看了~ 45\n",
      "你还是笑起来最好看了~ 50\n",
      "你还是笑起来最好看了~ 55\n",
      "你还是笑起来最好看了~ 60\n",
      "你还是笑起来最好看了~ 65\n",
      "你还是笑起来最好看了~ 70\n",
      "你还是笑起来最好看了~ 75\n",
      "你还是笑起来最好看了~ 80\n",
      "你还是笑起来最好看了~ 85\n",
      "你还是笑起来最好看了~ 90\n",
      "你还是笑起来最好看了~ 95\n",
      "你还是笑起来最好看了~ 100\n"
     ]
    }
   ],
   "source": [
    "\n",
    "count = 0\n",
    "while True:\n",
    "    # count = count+1\n",
    "    count +=5\n",
    "    print(\"你还是笑起来最好看了~\",count)\n",
    "    if count == 100:\n",
    "        break"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "935f5219",
   "metadata": {},
   "source": [
    "#### 简单的数据结构有 ： 数值和字符串\n",
    "#### 模拟数据库数据 复杂的数据结构："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "171f26d9",
   "metadata": {},
   "outputs": [],
   "source": [
    "user_data = [\"zhichao\",\"youge\",\"gaojin\",\"zhaoman\"]\n",
    "password_data = [\"123456\",\"436432\",\"47382\"]\n",
    "\n",
    "count = 3\n",
    "while True:\n",
    "    count -= 1\n",
    "    # 用户输入数据\n",
    "    username = input(\"请输入您的账号：\")\n",
    "    password = input(\"请输入您的密码：\")\n",
    "    # 1. 先判断账号\n",
    "    if user_data == username:\n",
    "        if password_data == password:\n",
    "            # 占位符%s\n",
    "            print(\"欢迎%s登录系统使用~\"%(username))\n",
    "            break\n",
    "        else:\n",
    "            if count == 0:\n",
    "                print(\"你都输入三次了，还不对，笨死了~~~，别输了，5分钟后再来\")\n",
    "                break\n",
    "            else:\n",
    "                print(\"您输入的账号或密码不正确，请重新输入，您还有\",count,\"次机会~加油~\")\n",
    "    else:\n",
    "        if count == 0:\n",
    "            print(\"你都输入三次了，还不对，笨死了~~~，别输了，5分钟后再来\")\n",
    "            break\n",
    "        else:\n",
    "            print(\"您输入的账号或密码不正确，请重新输入，您还有\",count,\"次机会~加油~\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f3663951",
   "metadata": {},
   "source": [
    "## 注释\n",
    "#### 1. 可以记录我们的代码过程意义（一般循环、条件判断、函数、对象、类都要有自己的描述，对变量作描述）\n",
    "#### 2. 可以忽略一部分代码，跳过该部分执行的代码"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "649cc518",
   "metadata": {},
   "source": [
    "#### A. 单行注释： #\n",
    "#### B. 多行注释： ''' 注释内容 ''' \"\"\" 注释内容 \"\"\"\n",
    "#### C. 多行注释可以当做  str  赋值给变量\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b568daf5",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
